package com.woniuxy.dr_mall.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.dr_mall.entity.DrCategory;
import com.woniuxy.dr_mall.mapper.DrCategoryMapper;
import com.woniuxy.dr_mall.service.IDrCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 张哲轩
 * @since 2021-08-11
 */
@Service
public class DrCategoryServiceImpl extends ServiceImpl<DrCategoryMapper, DrCategory> implements IDrCategoryService {

    @Autowired
    private DrCategoryMapper drCategoryMapper;

    @Override
    public List<DrCategory> getAll() {
        return drCategoryMapper.getAll();
    }

    @Override
    public void addCategory(DrCategory drCategory) {
        drCategoryMapper.addCategory(drCategory);
    }

    @Override
    public DrCategory getById(int id) {
        return drCategoryMapper.getById(id);
    }

    @Override
    public void delById(int id) {
        drCategoryMapper.delById(id);
    }

    @Override
    public DrCategory getByName(String name) {
        return drCategoryMapper.getByName(name);
    }
}
